#include <iostream>
#include <fstream>
#include <string>

using std::cout;
using std::endl;
using std::cerr;
using std::ifstream;
using std::ofstream;
using std::string;

void test()
{
    ifstream ifs("3_funcPtr.cc");
    if(!ifs.good())
    {
        cerr << "ifstream is not good" << endl;
        return;
    }

    ofstream ofs("www.txt");
    if(!ofs.good())
    {
        cerr << "ofstream is not good" << endl;
        return;
    }

    string line;
    while(getline(ifs, line))
    {
        ofs << line << endl;
    }

    ifs.close();
    ofs.close();
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

